package com.jic.market.enums;

/**
 * 抽奖动作枚举
 */
public enum LotteryDrawResultCode {
    LOTTERY_DRAW_RESULT_WINNING(1,"中奖"),
    LOTTERY_DRAW_RESULT_NOT_WINNING(2,"未中奖"),
    LOTTERY_DRAW_RESULT_WINNING_THANKS(3,"谢谢参与"),
    LOTTERY_DRAW_RESULT_ACTIVITY_NOT_STARTED(4,"活动未开始"),
    LOTTERY_DRAW_RESULT_ACTIVITY_ALREADY_ENDED(5,"活动已结束"),
    LOTTERY_DRAW_RESULT_EXCEED_DAILY_DRAW_TIMES(6,"今日抽奖机会已用完"),
    LOTTERY_DRAW_RESULT_EXCEED_TOTAL_DRAW_TIMES(7,"抽奖机会已用完"),
    LOTTERY_DRAW_RESULT_NO_ENOUGH_POINTS(8,"积分不足"),
    LOTTERY_DRAW_RESULT_NO_ORDER_RECORD(9,"无有效订单"),
    LOTTERY_DRAW_RESULT_INVALID_ACTIVITY(10,"活动不存在"),
    LOTTERY_DRAW_RESULT_USER_NEW(11,"新用户不能参与此抽奖"),
    LOTTERY_DRAW_RESULT_USER_OLD(12,"老用户不能参与此抽奖"),
    LOTTERY_DRAW_RESULT_USER_GRADE(13,"会员等级未通过不能参与此抽奖"),
            ;

    private Integer code;
    private String msg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    private LotteryDrawResultCode(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }


    public static String getLotteryDrawResultMsgByCode(Integer code) {
        String msg = null;
        for (LotteryDrawResultCode enumVal : LotteryDrawResultCode.values()) {
            if (enumVal.getCode().equals(code)) {
                msg = enumVal.getMsg();
                break;
            }
        }
        return msg;
    }
}
